﻿using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using StudentManager.API.BLL;
using StudentManager.API.ViewMode;

namespace StudentManager.API.Controllers
{
    [Route("[controller]/[action]")]
    [ApiController]
    public class StudentExController([FromServices] StudentExBO stuBO):ControllerBase
    {
        //private StudentExBO stuBO;
        //public StudentExController()
        //{
        //    stuBo = new StudentExBO();
        //}
        [HttpPost]

        public IActionResult Add([FromBody]StudentInfo studentinfo)
        {
            return Ok(stuBO.Add(studentinfo));
        }
        [HttpGet]
        public IActionResult GetInfo([FromQuery]int id)
        {
            var res = stuBO.GetInfo(id);
            return Ok(res);
        }
    }
} 
